﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ContentPlaceHolderID="HeadContent" runat="server">
    
    <link href="<%=Page.ResolveUrl("~/Content/black-tie-1.8.1/jqueryui.css")%>" rel="stylesheet" type="text/css" />
    <script src="<%=Page.ResolveUrl("~/Content/Libs/jquery-1.4.2.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Content/Libs/jquery-ui.1.8.1.min.js")%>" type="text/javascript" ></script>
    <script src="<%=Page.ResolveUrl("~/Content/Libs/jquery.validate.min.js")%>" type="text/javascript"></script>
    <script src="<%=Page.ResolveUrl("~/Content/Libs/MicrosoftMvcJQueryValidation.js")%>" type="text/javascript"></script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<script type="text/javascript">
    $(function () {
        var cache = {};
        $("#release").autocomplete({
            source: function (request, response) {
                if (cache.term == request.term && cache.content) {
                    response(cache.content);
                    return;
                }
                if (new RegExp(cache.term).test(request.term) && cache.content && cache.content.length < 13) {
                    response($.ui.autocomplete.filter(cache.content, request.term));
                    return;
                }
                $.ajax({
                    url: "Sprint/Releases",
                    dataType: "json",
                    type: "POST",
                    data: request,
                    success: function (data) {
                        cache.term = request.term;
                        cache.content = data;
                        response(data);
                    }
                });
            },
            minLength: 1
        });
    });

    function TfsAutoComplete() {


    }
	</script>

    <h2>Index</h2>

    <% using(Html.BeginForm()) { %>

    Release: <%: Html.TextBox("release") %>
    Stream: <%: Html.TextBox("stream") %>

    Sprint: <%: Html.TextBox("sprint") %>
    Capacity (hours): <%: Html.TextBox("capacicity") %>
    Start: <%: Html.TextBox("start") %>
    Stop:  <%: Html.TextBox("stop") %>
    
    Team: <%: Html.TextBox("team") %>
    Capacity (hours): <%: Html.TextBox("capacity") %>

    <input type="submit" value="Save" />

    <%}%>

</asp:Content>